home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 050a / tse_mac1.zip / MAKECSV.ZIP / MAKECSV.DOC next >
Text File  |  1993-03-25  |  3KB  |  83 lines

  1.  
  2.                             MakeCSV.S
  3.  
  4.  
  5. A Macro that converts a datafile with positionally oriented
  6. records to a Comma Separated Value (.CSV) file.
  7.  
  8.     Features:
  9.  
  10.         o   Can include a header line.
  11.         o   Use any part or all of of the source file.
  12.         o   Output fields in a different order than the source
  13.             file.
  14.         o   Does not change the source file.
  15.  
  16. A positionally oriented record is one where each field length the
  17. same as that field length in all other records.  Field data are
  18. padded with blanks. Blanks follow character fields and normally
  19. preceed numeric fields.  This is a common format in older
  20. databases.
  21.  
  22. A Comma Separated Value record has each field separated by a
  23. comma.  Fields are only as long as the data in them.  Character
  24. fields are surrounded by double quotes. Numeric fields are not.
  25. .CSV fields are commonly used to exchange data between DOS and
  26. Macintosh databases and spreadsheets.
  27.  
  28.     Examples:
  29.  
  30.     Positionally oriented record file.
  31.  
  32.     First_Name      Last_name      Age Salary
  33.     Joseph          Blow            23  13000.25
  34.     Maggie          Malone          21  93072.01
  35.  
  36.     Comma Separated Value file.
  37.  
  38.     "First_Name,"Last_name","Age","Salary",
  39.     "Joseph","Blow",23,13000.25,
  40.     "Maggie","Malone",21,93072.01,
  41.  
  42.     Note:  Some applications may not allow you to include a
  43.     header with all string data with fields containing numeric
  44.     data.  In this case, omit the header data in the DEFINEcc.RCD
  45.     file (See following.)
  46.  
  47.  
  48. MakeCSV requires a file named DEFINEcc.RCD where cc can be any
  49. two characters.  The format of this file is one line for each
  50. field desired in the output file. Leave no blank lines.  Each
  51. line is formatted as follows:
  52.  
  53.     [Field Name], Beginning Column, Field Length, Character Field (Y/N?),
  54.  
  55.     Where:
  56.  
  57.         Field Name is a single string less than 16 characters. It
  58.         is omisable if not desired in the output, however, if
  59.         omitted for one field, it must be omited for all.
  60.  
  61.         Beginning Column is the starting column of the field.
  62.  
  63.         Field Length is maximum the number of characters in the
  64.         field.
  65.  
  66.         Character Field (Y/N?) indicates whether the field
  67.         contains other than numbers, a leading "-" or a single decimal.
  68.  
  69.     Example:
  70.  
  71.         Last_Name,1,16,Y,
  72.         First_Name,17,16,Y,
  73.         Age,32,3,N,
  74.  
  75.     Fields must be defined in the order they are to appear in the .CSV
  76.     file, but not every field in the input need be used nor do fields
  77.     need to be in the same order as in the source file.
  78.  
  79.     Results are placed in file RESULTcc.CSV where "cc" is the same
  80.     characters as used in the suffix to DEFINEcc.RCD.
  81.  
  82.                            M. W. Hulse
  83.                           March 25, 1993